﻿using System;
using System.Drawing.Design;
using System.ComponentModel;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Web.UI.Design.WebControls;

namespace Water.Web.Controls.Design
{
     public class AccordionNodeCollectionEditor:UITypeEditor
    {
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IDesignerHost service = (IDesignerHost)context.GetService(typeof(IDesignerHost));
            Accordion instance = (Accordion)context.Instance;
            ((AccordionControlDesigner)service.GetDesigner(instance)).InvokeTreeNodeCollectionEditor();
            return value;
        }

        public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.Modal;
        }

    }
}
